<template>
  <div>
    <el-dialog
      title="新增图书"
      :visible="visible"
    >
      <div><span>图书名称:</span>
        <el-input
          class='elinput'
          v-model="data.title"
        ></el-input>
      </div>
      <div><span>发布日期:</span>
        <el-input
          class='elinput'
          v-model="data.pub_date"
        >
        </el-input>
      </div>
      <div><span>阅读量:</span>
        <el-input
          class='elinput'
          v-model="data.read"
        ></el-input>
      </div>
      <!-- <div><span>评论量:</span>
        <el-input
          class='elinput'
          v-model="data.bcomment"
        ></el-input>
      </div> -->

      <el-button @click="cancel">取 消</el-button>
      <el-button
        type="primary"
        @click="addBook"
      >确 定</el-button>
    </el-dialog>
  </div>
</template>
<script>
// import { addbook } from '@/http/apis'
export default {
  props: ['data', 'visible'],
  data() {
    return {
    }
  },
  methods: {
    addBook() {
      this.$emit('update:visible', false)
      this.$emit('save')
    },
    cancel() {
      this.$emit('update:visible', false)
    }
  },
  mounted() {
  }
}
</script>
<style>
.elinput {
  width: 220px;
  height: 40px;
}
</style>